This invention relates to a picture data compressing device which may be advantageously employed in an equipment handling compressed picture data, such as a digital Video Tape Recorder (VTR), television telephone system, teleconference system or a transmitter for a television station, and a red data detection device employed in such picture data compressing apparatus.
There has been known a digital VTR for digital recording/reproduction of picture information data. The recording system of the digital VTR is arranged as shown for example in FIG. 13, in which audio signals are fed via an input terminal 50 to an A/D converter 51 and picture signals are fed via an input terminal 53 to an A/D converter 54.
The A/D converter 51 digitizes the audio signals to generate audio data which is supplied to an audio recording processing circuit 52 which then processes the audio data into a form suitable for recording and transmits the processed audio data to an error correction encoding circuit 61.
The A/D converter 54 digitizes the picture signals by, for example, frame-based sampling, to generate component data, that is luminance data (Y data) and two color difference data (R-Y data and B-Y data), and transmits the component data to a blocking circuit 56 within a compression encoding circuit 55.
The blocking circuit 56 divides each of the Y-data, R-Y data and the B-Y data into blocks each consisting of a matrix of 8 vertically arrayed pixels and 8 horizontally arrayed pixels (DCT blocks), these blocks being routed to a shuffling circuit 57.
The shuffling circuit 57 generates a single macro-block from 8 DCT blocks, namely 6 Y data blocks, 1 R-Y data block and 1 B-Y data block. These 8 blocks are located at the same location on a picture. The shuffling circuit 57 effects pre-set shuffling on the macro-block basis, generates a single unit from five macro-blocks and outputs data on the unit basis. The unit picture data is supplied to a discrete cosine transform (DCT) circuit 58.
The DCT circuit 58 transforms the picture data of each macro-block making up the unit with data on the time scale into that on the frequency scale, and routes the transform coefficients to a quantization circuit 59.
The quantization circuit 59 selects such quantization coefficients which will give a fixed data length of the unit picture data outputted from a variable length encoding circuit 60 as later explained, and re-quantizes the unit-based picture data with the aid of these quantization coefficients. The unit-based picture data thus re-quantized is supplied to the variable length encoding circuit 60.
The variable length encoding circuit 60 processes the unit-based data into fixed-length data so that the data quantity of the picture data is not more than a pre-set quantity, and routes the resulting fixed-length data to the error correction coding combining circuit 61.
The error correction coding combining circuit 61 combines the unit-based picture data having the fixed length with the audio data supplied from the audio data recording processing circuit 52 to generate recording data. In addition, the error correction encoding combining circuit 61 appends so-called parity data for error correction to the recording data and routes the resulting signals to a recording modulation circuit 62.
The recording modulation circuit 62 modulates the recording data from the combining operation in a pre-set manner and routes the resulting modulated signals to a recording head 63. The recording head 63 records the picture data obliquely on a video tape, not shown.
By digitally recording the picture data (and audio data) in this manner, recording/ reproduction may be achieved without deteriorating the picture quality by preventing adverse effects of the random noise or the like.
However, the above-mentioned digital VTR has a drawback that, since the picture data are divided into plural macro-blocks and processed with DCT or re-quantization or the like on the macro-block basis, there arises the risk of occurrence of so-called block distortion, in which the noise is produced at a junction between macro-blocks on the reproduced picture. Above all, the block distortion of a macro-block containing a large quantity of red-hued picture data, tends to be visually outstanding, and thus has been desired to be improved.
In view of the above-described problem of the prior art, it is an object of the present invention to provide a picture data compressing apparatus in which the block distortion containing a large quantity of the red-hued picture data is diminished to contribute to improvement in the picture quality.
It is another object of the present invention to provide a red data detection device in which the number of bits required in determining whether or not the picture data is red-hued may be reduced for simplifying the hardware.
The present invention provides a picture compressing device including blocking means for dividing picture data into plural blocks each consisting of a pre-set number of blocks and outputting the resulting blocked picture data, and transform encoding means for transform encoding picture data from the blocking means on the block basis and outputting resulting transform coefficients. The picture compressing device also includes red block detecting means for detecting the block transmitted thereto from the blocking means as being a red block if the block has more than a pre-set number of picture data of red-hued pixels, and quantization means for quantizing transform coefficients from the transform coding means. The picture compressing device additionally includes control means for variably controlling the quantization steps of the quantization means if the block is detected as being a red-hued block by the red block detection means.
With the picture data compressing device according to the present invention, the controlling means variably controls the quantization step of the quantization means so that the quantization step will become finer if the block is detected as being a red-hued block by the red block detection means.
With the picture data compressing device according to the present invention, the controlling means variably controls the quantization step of the quantization means quantizing red data so that the quantization step will become finer for a macro-block consisting of a luminance data block and two color data blocks.
With the picture data compressing device according to the present invention, controlling means performs activity-based classing for a pre-set number of macro-blocks as a processing unit, and adaptively controls the quantization steps of the quantization means according to classes so that such class is selected in which the quantization step of the quantization means quantizing red-hued data is finest if the block from the blocking means is found to be the red-hued block by the red block detection means.
The present invention also provides a red data detecting, device including upper bit extracting means for extracting upper three bits of red-hued data supplied as 8-bit bi-level data and outputting the extracted upper three bits, threshold outputting means for outputting, as threshold data, upper three bits of 8-bit bi-level data that is closest to a reference value employed in detecting red data and that may be divided out by a power of 2, where an exponent is a natural number, and comparator means for comparing red-hued data from the upper bit extracting means with threshold data from the threshold data outputting means. The comparator means outputs high-level red detection data indicating that the picture data is the red data or the low level red detection data indicating that the picture data is not red data when the red data is larger or smaller than the threshold data, respectively.
The present invention also provides a red data detecting device including upper most bit extracting means for extracting upper most bit of blue-hued data supplied as 8-bit bi-level data and outputting the extracted upper most bit, and inverting means for inverting an upper most bit of low level blue-hued data indicating that the picture data is the red data when the upper most bit is supplied from the upper most bit extracting means and outputting the inverted data; as a high level red detection data and for inverting an upper most bit of high level blue-hued data indicating that the picture data is not the red data when the upper most bit is supplied from the upper most bit extracting means and outputting the inverted data as a low level red detection data. The red data detecting device also includes red data detection means for outputting high-level red detection data indicating that picture data is red data only when high-level red detection data is supplied from the comparator means at the same time as high-level red detection data is supplied from the inverting means.
With the red data detection device according to the present invention, threshold data outputting means output upper three bits of bi-level data for 160 which is an 8-bit bi-level data that may be divided by some power of 2, where an exponent is a natural number, as the threshold data, and, if the picture data is red-hued picture data, the blue-hued color data has a value not more than 128 where 1 stands only at the upper most bit of the 8-bit blue color data, the upper most bit extracting means extracts the upper most bit from the 8-bit blue-hued data for outputting low-level blue-hued data indicating that the picture data is the red hued data by extracting the upper most bit from the 8-bit blue-hued data or outputting high level blue-hued data indicating that the picture data is not red picture data.
The present invention also provides a red data detecting device comprising upper bit extracting means for extracting upper three bits of red-hued data supplied as 8-bit bi-level data and outputting the extracted upper three bits, and threshold data outputting means for outputting, as threshold data, upper three bits of 8-bit bi-level data that is closest to a reference value in detecting red data and that may be divided out by a power of 2, where an exponent is a natural number. The red data detecting device also includes comparator means which is adapted for comparing red-hued data from the upper bit extracting means to the threshold data from the threshold data outputting means and for outputting high-level red detection data indicating that the picture data is the red data or the low level red detection data indicating that the picture data is not red data when the red data is larger or smaller than the threshold data, respectively. The red data detecting device additionally includes upper most bit extracting means for extracting the upper most bit of blue-hued data supplied as 8-bit bi-level data and outputting the extracted upper most bit, and inverting means for complementing an upper most bit of low level blue-hued data indicating that the picture data is the red data when the upper most bit is supplied from the upper most bit extracting means and outputting the complemented data as a high level red detection data, and for complementing an upper most bit of high level blue-hued data indicating that the picture data is not the red data when the upper most bit is supplied from the upper most bit extracting means and outputting the inverted data as a low level red detection data. The red data detecting device finally includes red data detection means for outputting high-level red detection data indicating that picture data is red data only when high-level red detection data is supplied from the comparator means at the same time as high-level red detection data is supplied from the inverting means, and a red block discrimination data outputting means having its count value reset for each of pre-set units of picture data and having its count value set to a power of 2, where an exponent is a natural number. The red block decision data outputting means counts the high level red detection data from the red data detection means for each of the pre-set units of picture data and outputs red block decision data indicating that the pre-set unit of picture data is red picture data when the count value of the red detection data reaches the pre-set count value.
With the picture data compressing device according to the present invention, the blocking means divides supplied picture data into plural blocks each consisting of a pre-set number of pixels, and routes the blocked data to transform encoding means and red block detection means. The transform encoding means encode the picture data from the blocking means on the block basis to generate transform coefficients which are routed to the quantization means. The quantization means re-quantize block-based picture data supplied from the transform encoding means. If the red block detecting means detect that the block is the red block, the control means variably controls the quantization step of the R-Y data in the quantization means so that the quantization step in the quantization means will be finer, thereby enabling it to finely re-quantize picture data of the red block.
The red data detection device of the present invention discriminates whether or not the picture data is red picture data based upon the red hued data among the luminance data and two color data, that is red-hued data and blue-hued data, formed from the picture data. The upper bit extraction means extract upper three bits of the red-hued data supplied as 8-bit bi-level data and routes the extracted data to comparator means. That is, the upper bit extraction means extracts fifth to seventh bits from among red-hued data supplied as the 0th to 7th bits, for a total of 8 bits, and routes the extracted bits to the comparator means.
On the other hand, the threshold data outputting means routes to the comparator means threshold data corresponding to upper three bits from among 8-bit bi-level data which is closest to a reference value in detecting red data and which is represented by some power of 2, where an exponent is a natural number.
Specifically, a value in the neighborhood of 170 is desirable as a reference value in detecting red data. The 8-bit bi-level data that may be divided out by some power of 2 and that is closest to 170 is 160 which may be divided out by 25. 160 is represented in 8 bits as xe2x80x9c10100000xe2x80x9d in which 0s are arrayed next to upper three bits.
The binary data smaller than 160 (0 to 159) is xe2x80x9c00000000xe2x80x9d to xe2x80x9c10011111xe2x80x9d, with the upper three bits being necessarily smaller than 101. This indicates that red-hued data can be detected only with the upper three bits.
Thus the threshold data outputting means output only the upper three bits, namely xe2x80x9c101xe2x80x9d, of the 8-bit bi-level data xe2x80x9c10100000xe2x80x9d, to the comparator means as the above-mentioned threshold data.
The comparator means compares the red-hued data from the upper bit extracting means with threshold data from the threshold data outputting means. If the red-hued data is larger than the threshold data, the comparator means outputs high-level red detection data indicating that the picture data is red data. Conversely, if the red-hued data is smaller than the threshold data, the comparator means outputs low-level red detection data indicating that the picture data is not red data.
That is, if the upper three bits of the red-hued data is xe2x80x9c101xe2x80x9d or higher, the picture data is very likely to be red data, so that the comparator means outputs high-level red detection data. Conversely, if the upper three bits of the red-hued data is less than xe2x80x9c101xe2x80x9d, the picture data is hardly likely to be red data, so that the comparator means outputs low-level red detection data.
If the threshold data is 175, it is necessary to compare the threshold data for 175, that is xe2x80x9c10100111xe2x80x9d, with the above-mentioned 8-bit red-hued data, so that 8-bit comparator means is required. However, by setting the threshold data so as to be a value that may be divided out by some power of 2, it becomes possible to discern whether or not the picture data is red based upon comparison of the upper three bits. Thus it becomes possible to discern the color with a number of bits equal to the number of bits of the supplied red-hued data less the exponent. Thus it becomes possible to decrease the number of bits necessary for discrimination, thereby simplifying the hardware and lowering the cost. In addition, since it is possible to detect whether or not the picture data is red picture data, the red detection device may be provided in, for example, a digital VTR in which DCT processing and re-quantization, for example, are carried out on the macro-block basis, so that, if the macro-block is found to be replete with red picture data, the quantization step may be refined for re-quantization, thereby alleviating the so-called block distortion for improving the picture quality.
However, if the picture data is determined to be red data or not based only on the gradation values of red-hued data, some detection error is produced.
Consequently, with the red data detection device according to the present invention, whether or not certain picture data is red picture data is determined based upon blue-hued data as well, and the result of decision with the red-hued data is combined with the result of decision with the blue-hued data in order to determine whether or not the picture data is red picture data.
That is, the red data detection device according to the present invention extracts only the upper most bit of the blue-hued data supplied as 8-bit bi-level data. The reason is that 128, for example, is desirable as a reference value if whether or not the picture data is red data is to be determined with the use of the blue-hued data. 128 may be divided out by 27 and may be represented with 8-bit bi-level data as xe2x80x9c10000000xe2x80x9d. Consequently, in determining whether or not the picture data is red data with the use of the blue-hued data, it suffices if it is determined whether the upper most bit of the blue-hued data is xe2x80x9c1xe2x80x9d or xe2x80x9c0xe2x80x9d. Thus the upper most bit extracting means extracts and outputs only the upper most bit of the blue-hued data supplied as the 8-bit bi-level data.
If the picture data is red picture data, the blue-hued data has the gradation value of 128 or less. The picture data with blue-hued data having the gradation value in excess of 128 is not red picture data. For this reason, if the picture data is red picture data, the upper most bit extraction means outputs low-level data, whereas, if the picture data is not red picture data, the upper most bit extraction means outputs high-level data.
The inverting means complement data from the upper most bit extracting means, and transmit the complemented data as red detection data to the red detection means. The red detection means outputs high-level red detection data indicating that the picture data is red data only when the high-level red detection data is supplied from the comparator means and simultaneously the high-level red detection data is supplied from the inverting means.
That is, the red data detection means take the picture data as being red picture data when the red-hued data has the gradation value in excess of 160 and the blue-hued data has the gradation value of 128 or less, and outputs the above-mentioned high-level red detection data.
By discriminating whether or not the picture data is red picture data with the use of both the red-hued data and the blue-hued data, red data detection may be achieved more accurately. In addition, by setting the threshold value of the blue-hued data so as to be divisible by some powers of 2, the number of bits required for discrimination can be reduced, for example, it can be reduced to one if the threshold value is 128. Thus, 16 bits required for discrimination with the use of 8 bits each of the red-hued data and the blue-hued data can now be reduced to three bits for the red-hued data and to one bit for the blue-hued data, thus totalling art four bits, thereby simplifying the hardware and lowering the cost.
Next, if processing is to be made on the macro-block basis, as in the case of the above-mentioned digital VTR, it is desirable to control the quantization steps depending on the number of red picture data owned by each macro-block. With this consideration, the red data detection device counts the number of red picture data on the basis of a pre-set processing unit, such as a macro-block, and determines the picture data of such pre-set processing unit to be red picture data when a number of the red picture data in excess of a pre-set value exists in the processing unit.
Thus the red data detection device routes red detection data from red data detection means detecting whether or not the picture data is red picture data to red block discrimination data outputting means based upon the red-hued data and the blue-hued data as described above. The red block discrimination data outputting means is a counter having the capacity of counting up to a certain power of 2, with an exponent being a natural number, for example, a 3-bit counter capable of counting the numbers from 0 to 7. It is reset for each pre-set processing unit, for example, for each macro-block. The red block discrimination data outputting means counts the number of high-level red detection data from the red data detection means. If a number of the high-level red detection data not less than eight is supplied within a time period for one macro-block, the counter outputs red block discrimination data indicating that the macro-block is the red macro-block.
This diminishes the number of counter stages and enables the discrimination of whether or not the picture data is the red picture block to be made on the basis of a pre-set processing unit, such as a macro-block.
Since it is possible with the picture data compressing device of the present invention to re-quantize picture data of red-hued blocks, the picture data of the red-hued blocks may be improved for reproduction. In addition, by re-quantizing the picture data of the red-hued blocks with finer quantization steps on detection of such red-hued blocks, the picture data of the red-hued blocks, otherwise affecting the remaining blocks, that is Y-data and B-Y data blocks, may be improved for reproduction. The result is that block distortion in the reproduced picture of the red-hued picture data may be diminished to contribute to the improved quality of the reproduced picture.
Since the red data detection device of the present invention sets the threshold value for detection of whether or not the picture data is red picture data to a value divisible by powers of 2, as described above, the number of bits necessary for discrimination may be reduced, thus simplifying the hardware and lowering the cost. In addition, since the red detection data used in determining whether or not the picture data is the red picture data is counted using a counter having the capacity of counting up to a pre-set power of 2, the number of the counter stages may be decrease, while red block decision is made on the basis of a pre-set processing unit. Furthermore, it can be detected whether or not the picture data is the red picture data, so that, by providing the red data detection device in a digital VTR executing DCT processing or re-quantization on the basis of a pre-set processing unit, and by refining the quantization steps for re-quantization if it is found that the picture of the preset processing unit contains a pre-set larger quantity of red picture data, it becomes possible to alleviate the block distortion to contribute to the improved picture quality.